package com.zfei.gfb.device;

import com.google.gson.Gson;
import com.zfei.gfb.util.gson.GsonBox;
import com.zfei.gfb.util.gson.GsonView;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
 * @author fgh
 */
@Configuration
@ConditionalOnClass(Gson.class)
public class GsonConfig {

    @Bean
    @Primary
    @Qualifier(GsonView.PUBLIC)
    public Gson gson() {
        return GsonBox.PUBLIC;
    }
}
